<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStudentCoursesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     * 学生课程表
     *
     */
    public function up()
    {
        Schema::create('student_courses', function (Blueprint $table) {
            $table->id();
            $table->string('classes',50)->comment('班级');
            $table->string('schooltime',128)->comment('上课时间');
            $table->enum('week',
                [
                    '星期一',
                    '星期二',
                    '星期三',
                    '星期四',
                    '星期五',
                    '星期六',
                    '星期日',
                ]
            )->comment('星期');
            $table->string('subject',50)->comment('科目');
            $table->foreignId('teachers_id')->comment('老师id');
          //相当于 $table->unsignedBigInteger('teachers_id')
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('student_courses');
    }
}
